home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / doc / showhaus < prev    next >
Text File  |  1997-07-08  |  1KB  |  50 lines

  1. ; This batch file creates four three-dimensional representations of
  2. ; a house. The example is from Chapter 11, "Plotting Multi-dimensional
  3. ; Arrays", of _Using IDL_.
  4.  
  5. ; Create a handy constant.
  6. H = [0.5, 0.5, 0.5]
  7.  
  8. ; Create a window for the first image.
  9. WINDOW, 1, XSIZE=500, YSIZE=350
  10.  
  11. ;Set up no rotation, scale, and draw house.
  12. T3D, /RESET & HOUSE
  13.  
  14. ; Use the READ procedure to prompt the user to press a key. The
  15. ; value stored in the variable 'var' is not used. 
  16.  
  17. var=''
  18. READ, var, $
  19.     PROMPT='Press Return to display the house rotated 30 degrees'
  20.  
  21. WINDOW, 2, XS=500, YS=350
  22.  
  23. ;Straight projection after rotating 30 degrees about x and y axes. 
  24. T3D, /RESET, TRANS = -H, ROT = [30, 30, 0] & T3D, TR = H & HOUSE
  25.  
  26. READ, var, $
  27.     PROMPT='Press Return to display the house with an oblique projection'
  28.  
  29. WINDOW, 3, XS=500, YS=350
  30.  
  31. ;No rotation, oblique projection, z factor = 0.5, angle = 45. 
  32. T3D, /RESET, TRANS = -H, ROT=[0, 0, 0], OBLIQUE=[.5, -45] & T3D, TR = H & HOUSE
  33.  
  34. READ, var, $
  35.     PROMPT='Press Return to display the house rotated 6 degrees, with perspective'
  36.  
  37. WINDOW, 4, XS=500, YS=350
  38.  
  39. ;Rotate 6 degrees about x and y, then apply perspective. 
  40. T3D, /RESET, TR=-H, ROT=[-6, 6, 0], PERS=4 & T3D, TR=H & HOUSE
  41.  
  42. READ, var, $
  43.     PROMPT='Press Return delete all four windows'
  44.  
  45. ; Delete the windows.
  46.  
  47. WDELETE, 1, 2, 3, 4
  48.  
  49.  
  50.